php get extension from string

54

php get file extension from filename -

$ext = pathinfo($filename, PATHINFO_EXTENSION);

php get extension from string -

$ext = pathinfo($filename, PATHINFO_EXTENSION);

//Remember that if you want to be able to deal with non ASCII characters, you need to set the locale first. E.G:
setlocale(LC_ALL,'en_US.UTF-8');

Comments

Submit
0 Comments